<extend name="_layout/main"/>
<block name="head">

</block>
<block name="top">
    <header class="mui-bar mui-bar1 mui-bar-nav mui-bar-nav1" id="header">
        <a class="btn" href="javascript:history.go(-1)">
            <i class="iconfont icon-fanhui"></i>
        </a>
        <div class="top-sch-box top-sch-boxtwo top-sch-boxthree flex-col">
            返回
        </div>
    </header>
</block>
<block name="content">
    <div class="warp warpthree clearfloat">
        <include file="_layout/member_head"/>
        <div class="apply recharge clearfloat">
            <form name="resetForm" id="resetForm" action="{:U('Member/update_password')}">
                <div class="appxiugai clearfloat">
                    <ul>
                        <li class="ra3 fl">
                            <i class="iconfont icon-mima fl"></i>
                            <input type="password" name="old_password" id="old_password" placeholder="确认输入原始密码"/>
                        </li>
                        <li class="ra3 fl">
                            <i class="iconfont icon-mima fl"></i>
                            <input type="password" name="new_password" id="new_password" placeholder="请输入新密码"/>
                        </li>
                        <li class="ra3 fl">
                            <i class="iconfont icon-mima fl"></i>
                            <input type="password" name="confirm_new" id="confirm_new" placeholder="确认新密码"/>
                        </li>
                    </ul>
                </div>
                <div class="xia clearfloat">
                    <a href="javascript:void(0)" class="db fl btn ra3" id="btn-save">确定</a>
                    <a href="javascript:void(0)" class="db fr btn ra3" id="btn-reset">重置</a>
                </div>
            </form>
        </div>
    </div>
</block>
<block name="scripts">
    <script>
        $(document).on('click', '#btn-reset', function (e) {
            document.getElementById('resetForm').reset();
        })
        $(document).on('click', '#btn-save', function (e) {
            e.preventDefault();
            var form = $("#resetForm");
            if (!form.is("form")) {
                return;
            }

            var action = form.attr('action');
            var data = form.serialize();
            if (action && data) {
                $.post(action, data, function (xdata) {
                    mui.alert(xdata.message,'提示');
                    if(xdata.status == 'success'){
                        form[0].reset();
                    }
                }, 'json');
            }
        })
    </script>
</block>